package com.ftf.tp.blog.infrastructure.converter;

import com.ftf.tp.blog.domain.article.aggregate.ArticleAgg;
import com.ftf.tp.blog.domain.article.dos.*;
import com.ftf.tp.blog.infrastructure.mapper.pos.ArticlePO;
import com.ftf.tp.blog.infrastructure.mapper.pos.ArticleDataPO;
import com.ftf.tp.blog.infrastructure.mapper.pos.ArticleEs;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 文章相关领域对象转换器
 *
 * @author tanghao
 * @date 2022/6/26
 */
@Mapper
public interface ArticleConverter {

    ArticleConverter INSTANCE = Mappers.getMapper(ArticleConverter.class);

    ArticlePO doToPo(ArticleDO articleDO);

    ArticleDataPO doToPo(ArticleDataDO articleDataDO);

    ArticleEs aggToEs(ArticleAgg articleAgg);

    ArticlePO aggToPo(ArticleAgg articleAgg);

    List<ArticleEs> doToPoList(List<ArticleEsDO> articleEsDOList);

    List<ArticleIndexDO> esToDoList(List<ArticleEs> recordList);

    ArticleInfoDO esToInfoDO(ArticleEs articleEs);

    ArticleDO poToDo(ArticlePO selectById);
}

